<template>
  <div class="m-info-card">
    <m-flex>
      <div
        v-for="(item, index) in data.content"
        :key="'card' + index"
        class="m-info-card__item"
      >
        <div class="m-info-card__label" :style="{ width: data.labelWidth }">
          <span>{{ item.label }}：</span>
        </div>
        <div class="m-info-card__value" :style="{ width: data.valueWidth }">
          <el-tooltip :content="item.value" placement="bottom">
            <span>{{ item.value }}</span>
          </el-tooltip>
        </div>
      </div>
    </m-flex>
  </div>
</template>
<script>
export default {
  name: 'MInfoCard',
  props: {
    data: {
      default: () => {},
      type: Object,
    },
  },
};
</script>
<style lang="less">
.m-info-card {
  padding: 10px;
  box-sizing: border-box;
  .m-info-card__item {
    display: flex;
    font-size: 14px;
    margin: 10px 0;
    .m-info-card__label {
      height: 20px;
      line-height: 20px;
      color: @subheadingButtonColor;
      text-align: right;
    }
    .m-info-card__value {
      margin-left: 20px;
      height: 20px;
      color: @titleTextColor;
      line-height: 20px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      text-align: left;
    }
  }
}
</style>
